<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Search Admin</title>
    </h:head>
    <body> 

                <ui:composition template="./Test.xhtml">



                    <ui:define name="content">

                        <h:commandButton value="Add New Admin" action="AddAdmin.xhtml" type="image" image="../resources/images/table/new_icon.png"></h:commandButton>
                        <p:dataTable var="item" value="#{searchBean.searchAdmin}"
                                     paginator="true" rows="10"
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                     rowsPerPageTemplate="5,10,15">
                            <f:facet name="header">
                                List all Admin
                            </f:facet>

                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="UserName" />
                                </f:facet>
                                <h:outputText value="#{item.userName}" />
                            </p:column>

                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Password" />
                                </f:facet>
                                <h:outputText value="#{item.password}" />
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Full Name" />
                                </f:facet>
                                <h:outputText value="#{item.fullName}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Address"/>
                                </f:facet>
                                <h:outputText value="#{item.address}">
                                </h:outputText>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Phone"/>
                                </f:facet>
                                <h:outputText value="#{item.phone}">
                                </h:outputText>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Email"/>
                                </f:facet>
                                <h:outputText value="#{item.email}">
                                </h:outputText>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Birthday"/>

                                </f:facet>
                                <h:outputText value="#{item.birthday}" >
                                    <f:convertDateTime pattern="MM/dd/yyyy" timeZone="VST"/>
                                </h:outputText>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    Update
                                </f:facet>
                                <h:commandButton action="updateAdmin"  value="Update" type="image" image="../resources/images/table/action_edit.gif">
                                    <f:setPropertyActionListener value="#{item}"
                                                                 target="#{adminBean.selectedAdmin}" />
                                </h:commandButton>

                            </p:column>

                            <p:column>
                                <f:facet name="header">
                                    Delete
                                </f:facet>
                                <h:commandButton action="AdminHome" actionListener="#{adminBean.deleteAdmin(item)}"  value="Delete" type="image" image="../resources/images/table/action_delete.gif"/>
                            </p:column>

                        </p:dataTable>




                    </ui:define>



                </ui:composition>
           
    </body>
</html>
